<?php /* Smarty version Smarty-3.1.6, created on 2018-03-11 13:18:32
         compiled from "./Tpl/Admin\Business\store_edit.html" */ ?>
<?php /*%%SmartyHeaderCode:316105aa3dbb529d696-90720133%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '5016086d003327caf4a3b1e60de0028c3f349738' => 
    array (
      0 => './Tpl/Admin\\Business\\store_edit.html',
      1 => 1520745011,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '316105aa3dbb529d696-90720133',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.6',
  'unifunc' => 'content_5aa3dbb545ea1',
  'variables' => 
  array (
    'obj' => 0,
    'tradeArea' => 0,
    'tradeAreaId' => 0,
    'tradeAreaName' => 0,
    'preUploadUrl' => 0,
    'verificationId' => 0,
    'adminId' => 0,
    'businessItemKv' => 0,
    'selectedItems' => 0,
    'album' => 0,
    'img' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5aa3dbb545ea1')) {function content_5aa3dbb545ea1($_smarty_tpl) {?><?php if (!is_callable('smarty_function_html_checkboxes')) include 'E:\\findmeServer\\ThinkPHP\\Library\\Vendor\\Smarty\\plugins\\function.html_checkboxes.php';
?><?php echo $_smarty_tpl->getSubTemplate ("Public/top.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

</head>
<body>
<div id="warpper" style="height: 900px;">
    <div class="content" style="height: 900px;">
        <div class="location">明星管理</div>
        <?php echo $_smarty_tpl->getSubTemplate ("Business/nav.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

        <div class="topic">添加明星</div>
        <div class="form-box border0 border-box">
            <form action="<?php echo u(@ACTION_NAME);?>
" class="ui-form" method="post" id="addManagerForm">
                <input type="hidden" name="id" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['id'];?>
"/>



                <div class="ui-form-item">
                    <label class="ui-label">商圈：</label>
                    <select name="tradeAreaId" id="tradeArea" class="ui-select" style="width:200px;">
                        <?php  $_smarty_tpl->tpl_vars['tradeAreaName'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['tradeAreaName']->_loop = false;
 $_smarty_tpl->tpl_vars['tradeAreaId'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['tradeArea']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['tradeAreaName']->key => $_smarty_tpl->tpl_vars['tradeAreaName']->value){
$_smarty_tpl->tpl_vars['tradeAreaName']->_loop = true;
 $_smarty_tpl->tpl_vars['tradeAreaId']->value = $_smarty_tpl->tpl_vars['tradeAreaName']->key;
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['tradeAreaId']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['tradeAreaId']->value==$_smarty_tpl->tpl_vars['obj']->value['tradeAreaId']){?>selected <?php }?>><?php echo $_smarty_tpl->tpl_vars['tradeAreaName']->value;?>
</option>>
                        <?php } ?>
                    </select>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">列表图片：</label>
                <span class="picture_box picture_150 " id="listPic" >
                        <div class="a-imgBox" id="imgBox" <?php if ($_smarty_tpl->tpl_vars['obj']->value['listPic']){?> style="display:block;"<?php }else{ ?>style="display:none;"<?php }?>>
                            <input type="hidden" name="listPic" value="<?php echo $_smarty_tpl->tpl_vars['preUploadUrl']->value;?>
<?php echo $_smarty_tpl->tpl_vars['obj']->value['listPic'];?>
">
                            <a href="javascript:void(0);" class="a-close" onclick="deleteListPic()"></a>
                            <img src="<?php echo $_smarty_tpl->tpl_vars['preUploadUrl']->value;?>
<?php echo $_smarty_tpl->tpl_vars['obj']->value['listPic'];?>
" width="150" height="130" />
                        </div>
                        <div>
                            <a href="javascript:;" class="a-upload">
                                <input type="file" name="file"  >
                            </a>
                            <i>上传图片</i>
                            <i>150*130</i>
                        </div>
                    </span>
                </div>
                <div class="ui-form-item">
                    <label class="ui-label">门店名称：</label>
                    <input type="text" class="ui-text" name="storeName" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['storeName'];?>
" required/>
                </div>

                <input type="hidden" class="ui-text"  value="<?php echo $_smarty_tpl->tpl_vars['verificationId']->value;?>
" name="verificationId" />
                <input type="hidden" class="ui-text"  value="<?php echo $_smarty_tpl->tpl_vars['adminId']->value;?>
" name="adminId" />

                <div class="ui-form-item ">
                    <label class="ui-label">手机号：</label>
                    <input type="text" class="ui-text" name="phone" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['phone'];?>
" />
                    <input type="text" class="ui-text" name="password" placeholder="登陆密码" />
                </div>

                <div class="ui-form-item">
                    <label class="ui-label">联系人：</label>
                    <input type="text" class="ui-text" name="director" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['director'];?>
" />

                </div>


                <div class="ui-form-item">
                    <label class="ui-label">星级评分：</label>
                    <input type="number" min="0" max="10" class="ui-text" name="star" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['star'];?>
" />
                </div>


                <div class="ui-form-item ">
                    <label class="ui-label">营业时间：</label>
                    <input type="text" class="ui-text" name="openHour" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['openHour'];?>
" />
                </div>


                <div class="ui-form-item">
                    <label class="ui-label">门店坐标：</label>
                    <input type="text" class="ui-text" name="longitude" placeholder="经度" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['longitude'];?>
" />
                    <input type="text" class="ui-text" name="latitude" placeholder="纬度" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['latitude'];?>
" />
                </div>

                <div class="ui-form-item">
                    <label class="ui-label">经营项目</label>
                    <?php echo smarty_function_html_checkboxes(array('name'=>"businessItem",'options'=>$_smarty_tpl->tpl_vars['businessItemKv']->value,'checked'=>$_smarty_tpl->tpl_vars['selectedItems']->value,'separator'=>"&nbsp;"),$_smarty_tpl);?>

                </div>

                <div class="ui-form-item2 uploader" style="min-height: 157px">
                    <label class="ui-label">门店图集:</label>
                    <div style="width: 775px;display: inline-block;">
                    <?php  $_smarty_tpl->tpl_vars['img'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['img']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['album']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['img']->key => $_smarty_tpl->tpl_vars['img']->value){
$_smarty_tpl->tpl_vars['img']->_loop = true;
?>
                    <span class="picture_box picture_150">
                        <div class="a-imgBox"   style="display:block;">
                            <a href="javascript:void(0);" class="a-close" onclick="removeElement(this)"></a>
                            <img src="<?php echo $_smarty_tpl->tpl_vars['preUploadUrl']->value;?>
<?php echo $_smarty_tpl->tpl_vars['img']->value;?>
" width="150" height="130" />
                            <input type="hidden" name="album[]" value="<?php echo $_smarty_tpl->tpl_vars['img']->value;?>
" />
                        </div>
                    </span>
                    <?php } ?>

                    <span class="picture_box picture_150 " id="addImg" style="position: absolute;">
                        <div>
                            <a href="javascript:;" class="a-upload">
                                <input type="file" name="file"  >
                            </a>
                            <i>上传图片</i>
                            <i>150*130</i>
                        </div>
                    </span>
                    </div>

                </div>

                <div class="ui-form-item ">
                    <label class="ui-label">一句话描述：</label>
                    <input type="text" class="ui-text" name="summary" value="<?php echo $_smarty_tpl->tpl_vars['obj']->value['summary'];?>
" maxlength="50" style="width: 43rem"/>
                    <label >不超过50个字符</label>
                </div>

        <div class="reply_box">
            <label class="ui-label">门店介绍：</label>
            <textarea id="editor" name="desc" class="edui-default inline-block"><?php echo $_smarty_tpl->tpl_vars['obj']->value['desc'];?>
</textarea>
            <ul id="fixed" class="FloatingBox" style="display: none">
                <li id="company"><i class="FloatingIcon1"></i>平台名</li>
                <li id="author"><i class="FloatingIcon2"></i>小编名</li>
                <li id="ewm"><i class="FloatingIcon3"></i>二维码</li>
            </ul>

        </div>

                <div class="integral_btn-group">
                    <input type="submit" value="提交" class="ui-button"/>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<?php echo $_smarty_tpl->getSubTemplate ("Public/foot.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


<script>
    //删除图片
    function deleteListPic() {
        $('#imgBox').hide();
        $('.uptxt').text('上传图片');
        $('#listPic').val('');
    }


    function TestBlack(TagName){
        var obj = document.getElementById(TagName);
        if(obj.style.display==""){
            obj.style.display = "none";
        }else{
            obj.style.display = "";

            var address = $("#selectAddress").val();
            addr = address.split("/");
            var length = addr.length;
            var askLevel = length+1;
            var i;
            for(i=0;i<length;i++){
                if(addr[i] <= 0){
                    askLevel = parseInt(i+1);
                    break;
                }
            }
            if(askLevel > 3) askLevel = 3;
            tab('tab',3,askLevel);
        }
    }

    function tab(a,b,c) {
        for(i=1;i<=b;i++){
            if(c==i)
            {
                // 判断选择模块
                document.getElementById(a+"_mo_"+i).style.display = "block";  // 显示模块内容
                document.getElementById(a+"_to_"+i).className = "no";   // 改变菜单为选中样式

                var address = $("#selectAddress").val();
                addr = address.split("/");
                length = addr.length;
                var arrLength = 0;
                for(z=0;z<length;z++){
                    if(addr[z] > 0){
                        arrLength++;
                    }
                }
                if(c > arrLength+1){
                    //清空后两级数据(例如，只选择了省级数据，区和街道数据应清空)
                    for(var j=arrLength+2;j<=b;j++){
                        $("#"+a+"_mo_"+j).empty();
                    }
                } else {
                    if(c==1){
                        //显示省级数据
                        $("#"+addr[0]).attr('class','active');
                    } else{
                        area_id = addr[c-2];
                        var param = {provinceID:addr[0],area_id:area_id,level:c};

                        $.post("<?php echo U('Business/getArea_info');?>
",param,function (res) {
                            if(res.status == 1){
//                                        layer.msg(res.msg);
                            }else{
                                $("#"+a+"_mo_"+c).empty().append(res.dataHtml);
                                $("#"+addr[c-1]).attr('class','active');
                            }
                        });
                    }

                }
            }
            else{
                // 没有选择的模块
                document.getElementById(a+"_mo_"+i).style.display = "none"; // 隐藏没有选择的模块
                document.getElementById(a+"_to_"+i).className = "";  // 清空没有选择的菜单样式
            }
        }
    }

    function area_tab(a,b,c,id,name) {
        tab(a,b,c);
        orginalLevel = c-1;     //点击的那一级
        $("#"+a+"_mo_"+orginalLevel+" ul").find("li").each(function () {
            if ($(this).hasClass('active')) {
                $(this).removeClass('active');
            }
        });
        switch (parseInt(c)){
            case 2:
                $("#province").val(id);
                $("#provinceName").val(name);
                $("#showSelectAdd").val(name);
                $("#selectAddress").val(id);
                $("#city,#district").val('');
                $("#cityName,#districtName").val('');
                break;
            case 3:
                $("#city").val(id);
                $("#cityName").val(name);
                $("#showSelectAdd").val($("#provinceName").val()+'/'+name);
                $("#selectAddress").val($("#province").val()+'/'+id);
                $("#district").val('');
                $("#districtName").val('');
                break;
            case 4:
                $("#district").val(id);
                $("#districtName").val(name);
                $("#showSelectAdd").val($("#provinceName").val()+'/'+$("#cityName").val()+'/'+name);
                $("#selectAddress").val($("#province").val()+'/'+$("#city").val()+'/'+id);
                break;
        }
        $("#"+id).attr('class','active');
        if(c < 4){
            $("#"+a+"_mo_"+c+"").empty();
            var provinceID = $("#province").val();
            var param = {provinceID:provinceID,area_id:id,level:c};
            $.post("<?php echo U('Business/getArea_info');?>
",param,function (res) {
                if(res.status == 1){
                    layer.msg(res.msg);
                }else{
                    $("#"+a+"_mo_"+c+"").empty().append(res.dataHtml);
                }
            });
        } else if(c == 4){
            //关闭地址选择器
            TestBlack('carnub1');


            //修改商圈
            $.post("<?php echo U('Business/getTradeAreaKV');?>
",{areaId:id},function (res) {
                if(res.status == 1){
                    layer.msg(res.msg);
                }else{
                    $("#tradeArea").empty().append(res.dataHtml);
                }
            });


        }

    }


    (function ($) {
        'use strict';
        $.fn.uploader = function () {
            return this.each(function () {
                var $this = $(this);
                var $img = $this.find('img');
                var $file = $this.find('input[type=file]');
                var $hidden = $this.find('input[type=hidden]');
                var $txt = $this.find('i.uptxt');
                $file.AjaxFileUpload({
                    action: './api.php?m=Api&c=index&a=ajaxUpload&from=IMG_STORE_ALBUM',
                    onSubmit: function () {
                        $txt.text('上传中');
                    },
                    onComplete: function (filename, response) {
                        if(parseInt(response.id)>0){
                            $txt.text("上传成功");
                            newImg(response.msg);
                        }else{
                            $txt.text(response.msg);
                        }
                    }
                });
            });
        }
    })(jQuery);
    $('#addImg').uploader();


    (function ($) {
        'use strict';
        $.fn.uploader = function () {
            return this.each(function () {
                var $this = $(this);
                var $img = $this.find('img');
                var $file = $this.find('input[type=file]');
                var $hidden = $this.find('input[type=hidden]');
                var $txt = $this.find('i.uptxt');
                var $imgBox = $this.find('div[id=imgBox]');
                $file.AjaxFileUpload({
                    action: './api.php?m=Api&c=index&a=ajaxUpload&from=IMG_STORE_LIST',
                    onSubmit: function () {
                        $txt.text('上传中');
                    },
                    onComplete: function (filename, response) {
                        if(parseInt(response.id)>0){
                            $txt.text("上传成功");
                            $hidden.attr('value', response.msg);
                            $img.attr("src",response.msg);
                            $imgBox.css('display','block');
                        }else{
                            $txt.text(response.msg);
                        }

                    }
                });
            });
        }
    })(jQuery);

    $('#listPic').uploader();

    function removeElement(obj){
        $(obj).parents('.picture_150').remove();
    }

    function newImg(src){
        $img=$('<span class="picture_box picture_150"><div class="a-imgBox"  style="display:block;"><a href="javascript:void(0);" class="a-close" onclick="removeElement(this)"></a><img src="<?php echo $_smarty_tpl->tpl_vars['preUploadUrl']->value;?>
<?php echo $_smarty_tpl->tpl_vars['img']->value;?>
" width="150" height="130" /> <input type="hidden" name="album[]" value="" /></div></span>');
        $('#addImg').before($img);
        $img.find('input[type=hidden]').val(src);
        $img.find('img').attr('src',src);
    }
</script><?php }} ?>